fix(docs/examples): propagate forge build failures in compile-solidity#23346
Draft
AztecBot wants to merge 2 commits into
Draft
fix(docs/examples): propagate forge build failures in compile-solidity#23346AztecBot wants to merge 2 commits into
AztecBot wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
merge-train/spartanCI failed after #23336 (which only touchesyarn-project/end-to-end/src/e2e_amm.test.ts). Root cause is unrelated to that PR: a transient DNS failure onbinaries.soliditylang.orgwhileforgewas downloading solc causedforge buildforaave_bridgeto exit non-zero. The bash loop indocs/examples/bootstrap.sh::compile-solidityignored that and kept going. The function returned 0 withaave_bridge's artifacts never written, and downstreamvalidate_project aave_bridgefailed withTS2307: Cannot find module '../../../target/solidity/aave_bridge/AavePortal.sol/AavePortal.json'(and TS2578 knock-on noise from@ts-expect-errordirectives that suppressed viem's strict ABI typing).Log: http://ci.aztec-labs.com/bc425a95fd076f0d
Full analysis: https://gist.github.com/AztecBot/e0b9e2d66c2912f4179839796f97d47b
The reason the inner failure was silent is that
run_step(in the same file) callsset +ebefore invoking the step function, so the subshell'sforge buildfailures don't abort the loop, and the subshell's exit status reflects the lastforge build(which succeeded).What
docs/examples/bootstrap.sh::compile-solidity:forge buildin the existingci3/retryhelper (3 attempts × 5s sleep = ~10s of retry backoff per subdir, well under 30s).$OUTPUT_DIR/.failedmarker (the subshell can't mutate an outer-scope array).return 1. The outerrun_stepthen retries the whole step once more — worst case ~6 attempts before failing CI loudly.The happy path is unchanged: one
forge buildper subdir, no extra sleeps.Test plan
Verified locally with
HOME=/tmp ./docs/examples/bootstrap.sh compile-solidity:AavePortal.sol/AavePortal.json,MockERC20.sol/MockERC20.json,MockAToken.sol/MockAToken.json,MockAavePool.sol/MockAavePool.json) exist, exit 0.broken_test/Bad.solwith invalid Solidity):ci3/retryprintedFailed after 3 attempts: ..., marker captured,ERROR: Solidity compilation failed for: broken_test, exit 1.The DNS-failure itself can't be reproduced locally — that's the whole reason we're hardening the script.
Supersedes #23345 (used inline 5-attempt 5→80s backoff against
next; this PR uses the existing helper against the correct merge-train base with a tighter total backoff).Out of scope
validate-webapp-tutorialis also silently returning 0 today while emitting real type errors (EmbeddedWallet/PXEConfig/GasSettingsAPI drift) and a vite rollup error. Sameset +epattern. Not fixed here — needs its own PR with API updates to the tutorial code.ClaudeBox log: https://claudebox.work/s/95a1d08774663f9c?run=2